package sd.qd.xiaoming.coffeedesk.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.xml.bind.annotation.XmlRootElement;

@Entity
@XmlRootElement
public class CdNoteType extends BaseEntity {

	private String name;
	private Integer width;
	private Integer height;
	private String code;
	private List<CdNote> notes;

	public String getCode() {
		return this.code;
	}

	public Integer getHeight() {
		return this.height;
	}


	public String getName() {
		return this.name;
	}

	@OneToMany(targetEntity = CdNote.class, fetch = FetchType.LAZY, mappedBy = "type", cascade = { CascadeType.ALL })
	public List<CdNote> getNotes() {
		return this.notes;
	}

	public Integer getWidth() {
		return this.width;
	}

	public void setCode(final String code) {
		this.code = code;
	}

	public void setHeight(final Integer height) {
		this.height = height;
	}

	public void setName(final String name) {
		this.name = name;
	}

	public void setNotes(final List<CdNote> notes) {
		this.notes = notes;
	}

	public void setWidth(final Integer width) {
		this.width = width;
	}

	@Override
	public String toString() {
		return "CdNoteType [name=" + this.name + ", width=" + this.width + ", height=" + this.height + ", code=" + this.code + "]";
	}

}
